package com.baizhi.interfacex;

import java.util.Arrays;

public class ShortDemo01 {
    public static void main(String[] args) {

        //基本数据类型数组的排序
        int[] arr = {12,25,63,21,14,15};
        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));


        //引用数据类型数组的排序
        //Comparable<T>此接口强行对实现它的每个类的对象进行整体排序
        Student[] sts = new Student[5];
        sts[0] = new Student("安尚华",25,100,"河南郑州");
        sts[1] = new Student("王云爽",17,36,"江苏南京");
        sts[2] = new Student("李娜",18,77,"内蒙古呼和浩特");
        sts[3] = new Student("杨磊",32,8,"河北唐山");
        sts[4] = new Student("高富斌",8,25,"北京海淀");

        Arrays.sort(sts);
        System.out.println(Arrays.toString(sts));
    }
}
